package com.zjw.service.impl;

import com.zjw.dao.GradeDao;
import com.zjw.dao.impl.GradeDaoImpl;
import com.zjw.entity.Grade;
import com.zjw.service.GradeService;
import com.zjw.utils.ConnectionUtil;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

/**
 * @projectName: studentCourseSelectionManagement
 * @package: com.zjw.service.impl
 * @className: GradeServiceImpl
 * @author: 翟
 * @date: 2025/4/6 21:23
 */

public class GradeServiceImpl implements GradeService {
    @Override
    public List<Grade> findAll() {
        Connection conn = null;
        try {
            conn = ConnectionUtil.getConnection();
            GradeDao gradeDao = new GradeDaoImpl(conn);
            return gradeDao.selectAllGrade();
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            ConnectionUtil.closeALL(null , null , conn);
        }
        return null;
    }
}
